package com.garbagecan.cachestudy.ehcache;

import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class CacheExample {
	private static Log log = LogFactory.getLog(CacheExample.class);
	public static void main(String[] args) {
		createCache1();
		createCache2();
	}
	public static void createCache1() {
		CacheManager cacheManager = new CacheManager();
		cacheManager.addCache("myCache");
		log.info(cacheManager.getCache("myCache"));
		cacheManager.shutdown();
	}
	public static void createCache2() {
		CacheManager cacheManager = new CacheManager();
		Cache cache = new Cache("myCache", 1000, false, false, 5, 2);
		cacheManager.addCache(cache);
		log.info(cacheManager.getCache("myCache"));
		cacheManager.shutdown();
	}
}
